﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SM_SelectEmployee.aspx.cs" Inherits="ZLDC.Estate.TM.SM_SelectEmployee" Theme="NewSkin"%>
<%@ Register Src="../UserControl/Autocomplete.ascx" TagName="Autocomplete" TagPrefix="uc1" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>选择用户</title>
    <link href="../../cssnew/page.css" rel="stylesheet" type="text/css" />
    <style>
        .mainField
        {
            margin: 10px 6px 5px 10px;
            border: 0px solid #eee;
            clear: both;
            text-align: left;
        }
        a
        {
            color: blue;
            text-decoration: none;
        }
        a:hover
        {
            color: blue;
            text-decoration: underline;
        }
        a:visited
        {
            color: blue;
            text-decoration: none;
        }
    </style>

    <script language="javascript"> 
    <!--
    
    //打开模式对话框,strUrl为打开的带路径的URL,InValue为要传入的值

    function OpenModelessDialog(strUrl, InValue, strWidth, strHeight, sFeatures)
    { 
        var strFeatures;
        if(typeof(sFeatures)=="undefined")    
            strFeatures = "dialogWidth="+strWidth+"px;dialogHeight="+strHeight
                +"px;resizable:no;scrollbars:yes;center:yes;help:no;status:no";
        else
            strFeatures = "dialogWidth="+strWidth+"px;dialogHeight="+strHeight+"px;"+sFeatures;
        
        var sValue = showModalDialog(strUrl, InValue, strFeatures);
        return  sValue;
    }
    
    function ss(checks)
    {
        var qx=document.getElementsByTagName("input");
        var strValue=document.getElementById("txtIDS").value;
        for(var i=0;i<qx.length;i++)
        {
            if(qx[i].type == 'checkbox')
            {
                qx[i].checked=checks
                if(checks==true)
                {
                    if(qx[i].value!="on" &&
                    qx[i].value!="")
                    {
                        if(strValue.indexOf(qx[i].value)==-1)
                        strValue+=qx[i].value+",";
                    }
                }else
                {
                    if(qx[i].value!="on" && qx[i].value!="")
                    {
                        var strValue=strValue;
                        strValue=strValue.replace(qx[i].value+",","");
                    }
                }
            }
        }
        document.getElementById("txtIDS").value=strValue;
        //alert(strValue);
    }
    
    function SelectCheck(chechked,value)
    {
        var strValue=document.getElementById("txtIDS").value;
        if(chechked==true)
        {
            if(strValue.indexOf(value+",")==-1)
            {
               strValue=strValue+value+","; 
            }
        }
        else
        {
            if(strValue.indexOf(value+",")>-1)
            {
                strValue=strValue.replace(value+",","");
            }
        }
        document.getElementById("txtIDS").value=strValue;
        //alert(strValue);
    }
    
    function CheckData()
    {
        if(document.getElementById("txtIDS").value=="")
        {
            alert("请选择用户！");
            return false;
        }
    }
   --> 
    </script>
    <base target="_self" />
</head>
<body>
    <form id="form1" runat="server">
      <div id="hbNav">
        <div id="navLeft">
                <img src="../../images/zlTitle.gif" width="13" align="absmiddle" />&nbsp;&nbsp;当前功能<span
                class="hbdot">&raquo;</span>选择用户</div>
        <div id="navRght">
       
        </div>
    </div>
    <fieldset class="mainField">
        <div id="dvTable">
            <table border="0" cellpadding="1" cellspacing="1" width="98%">
                <tr>
                    <td class="searchLbl" width="20%">
                        姓名：

                    </td>
                    <td class="searchTxt" width="30%">
                        &nbsp;<uc1:Autocomplete ID="Autocomplete5" runat="server" selectType="User" Style="width: 98%"
                                    IsScript="true" />
                    </td>
                    <td class="searchLbl" width="20%">
                        工号：

                    </td>
                    <td class="searchTxt" width="30%">
                        &nbsp;<input type="text" id="txtEmployeeNo" class="textdocdown" runat="server" />
                    </td>
                   
                    <td></td>
                </tr>
                <tr>
                      <td class="searchLbl" width="20%">
                        部门名：
                    </td>
                    <td class="searchTxt" width="30%">
                        &nbsp;<uc1:Autocomplete ID="Autocomplete1" runat="server" selectType="Dept" Style="width: 98%"
                                    IsScript="true" />
                    </td>
                     <td class="searchLbl" width="20%">
                        职位：

                    </td>
                    <td class="searchTxt" width="30%">
                        &nbsp;<asp:DropDownList ID="DDStation" runat="server" style="width:70%"></asp:DropDownList>
                    </td>
                     <td class="searchBtn">
                        <asp:Button ID="btnSearch" runat="server" Text="查询" class="button_bak" 
                            onclick="btnSearch_Click" />
                      
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                      <asp:Button ID="btnSave" runat="server" Text="确认" class="button_bak" 
                            onclick="btnSave_Click" OnClientClick="return CheckData();"/>
                        <input type="button" id="btnClsoe" value="关闭" class="button_bak"  onclick="javascript:window.close();"/>
      <input type="hidden" id="txtIDS" runat="server" style="width:0px" />
                    </td>
                </tr>
            </table>
       
        <table border="1" cellpadding="0" cellspacing="0" class="datagrid-style" style="width: 100%">
            <tr class="datagrid-headerstyle">
                <td class="datagrid-headercolor" align="center">
                    <input type="checkbox" id="chkAll" onclick="ss(this.checked);" />
                </td>
                <td class="datagrid-headercolor" align="center">
                    <b>NO.</b>
                </td>
                <td class="datagrid-headercolor" align="center">
                    <b>工号</b>
                </td>
                <td class="datagrid-headercolor" align="center">
                    <b>姓名</b>
                </td>
                <td class="datagrid-headercolor" align="center">
                    <b>性别</b>
                </td>
                <td class="datagrid-headercolor" align="center">
                    <b>部门名称</b>
                </td>

            </tr>
            <asp:DataList ID="dlistData" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal"
                DataKeyField="序号">
                <ItemTemplate>
                    <tr id="trList" runat="server">
                     <td class="datagrid-style" style="width: 30px;" align="center">
                            <input type="checkbox" id="chkSelect" value='<%# Eval("序号")%>' onclick="SelectCheck(this.checked,this.value);" />
                        </td>
                        <td class="datagrid-style" style="width: 30px;" align="center">
                            <%# Eval("Row")%>
                        </td>
                        <td class="datagrid-style" style="width: 60px;" align="center">
                            <%# Eval("工号")%>
                        </td>
                        <td class="datagrid-style" style="width: 150px;">
                            <%# Eval("姓名")%>
                        </td>
                        <td class="datagrid-style" style="width: 150px;">
                            <%# Eval("性别")%>
                        </td>
                        <td class="datagrid-style">
                            <%# Eval("部门名称")%>
                        </td>

                       
                    </tr>
                </ItemTemplate>
            </asp:DataList></table>
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="paginator" SubmitButtonText="跳转"
            Width="100%" ShowPageIndexBox="Always" HorizontalAlign="Right" AlwaysShow="True"
            OnPageChanging="AspNetPager1_PageChanging" PageIndexBoxClass="pageTextBox" SubmitButtonClass="ibutton"
            SubmitButtonStyle="" CustomInfoTextAlign="Left" LayoutType="Table" ShowCustomInfoSection="Left"
            PageSize="15" FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PrevPageText="上一页">
        </webdiyer:AspNetPager>
         </div>
    </fieldset>
    </form>
</body>
</html>